<?
	extract($_POST);
	session_start();
	include "../db.php";
	$date = date("Y-m-d");
	if(isset($_SESSION['username']))
	{
		$username = $_SESSION['username'];
	
		$query_ins = "insert into friend (friend1_username, friend2_username, confirm, doc) values ('$username', '$friend_username', '0', '$date')";
		$result_ins = mysql_query($query_ins);

		if($result_ins)
		{
			header("location:home.php?msg=request sent!!!");
		}
		else
			header("location:home.php?msg=error in db...");		
	}
	else
		header("location:../login/login.php?msg=session break...");		
?>
